﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Approval.aspx.cs" Inherits="AspWebTest.Approval" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Button ID="Button_wait2do" runat="server" Text="待辦工作" 
            onclick="Button_wait2do_Click" />
        <asp:Button ID="Button_alreaydo" runat="server" Text="已辦工作" 
            onclick="Button_alreaydo_Click" />
        <asp:Button ID="Button_newdo" runat="server" Text="新建工作" 
            onclick="Button_newdo_Click" />
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="wf_id" DataSourceID="SqlDataSource1" ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="wf_id" HeaderText="wf_id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="wf_id" Visible="False" />
                <asp:BoundField DataField="form_id" HeaderText="form_id" 
                    SortExpression="form_id" Visible="False" />
                <asp:BoundField DataField="wftemplate_id" HeaderText="wftemplate_id" 
                    SortExpression="wftemplate_id" Visible="False" />
                <asp:HyperLinkField DataNavigateUrlFields="form_id,wf_id,wftemplate_id" 
                    
                    DataNavigateUrlFormatString="wfwithform.aspx?formid={0}&amp;wfid={1}&amp;wftempid={2}" DataTextField="流程" 
                    HeaderText="工作流名称" />
                <asp:BoundField DataField="分类" HeaderText="分类" SortExpression="分类" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource2" Width="619px" >
            <Columns>
                <asp:BoundField DataField="task_id" HeaderText="task_id" ReadOnly="True" 
                    SortExpression="task_id" />
                <asp:BoundField DataField="ptask_id" HeaderText="ptask_id" ReadOnly="True" />
                <asp:BoundField DataField="uniqueid" HeaderText="uniqueid" ReadOnly="True" 
                    SortExpression="uniqueid" />
                <asp:BoundField DataField="taskname" HeaderText="taskname" ReadOnly="True" 
                    SortExpression="taskname" />
                <asp:BoundField DataField="state" HeaderText="state" 
                    ReadOnly="True" SortExpression="state" />
                <asp:BoundField DataField="processtype" HeaderText="processtype" ReadOnly="True" 
                    SortExpression="processtype" />
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" 
                    SortExpression="id" />
                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" 
                    SortExpression="name" />
                <asp:BoundField DataField="duty_id" HeaderText="duty_id" ReadOnly="True" 
                    SortExpression="duty_id" />
                <asp:HyperLinkField DataNavigateUrlFields="task_id,uniqueid,ptask_id" 
                    DataNavigateUrlFormatString="WfProcess.aspx?taskid={0}&amp;&amp;uniqueid={1}&amp;&amp;ptaskid={2}" 
                    NavigateUrl="~/WfProcess.aspx" Text="处理" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:OAonlineConnectionString %>" 
            
            SelectCommand="select * from ((SELECT     dbo.wf_task.task_id,dbo.wf_task.ptask_id,dbo.wf_task.uniqueid, dbo.wf_task.taskname, 
dbo.wf_task.state, dbo.wf_task.processtype, dbo.system_users.id, dbo.system_users.name,
 dbo.system_users.duty_id FROM         dbo.system_users 
INNER JOIN dbo.wf_task ON dbo.system_users.id = dbo.wf_task.user_id WHERE     
(dbo.wf_task.state = N'未处理') AND (dbo.wf_task.processtype = N'按人员'))union
(SELECT     dbo.wf_task.task_id,dbo.wf_task.ptask_id,dbo.wf_task.uniqueid, dbo.wf_task.taskname, 
dbo.wf_task.state, dbo.wf_task.processtype, dbo.system_users.id, dbo.system_users.name,
 dbo.system_users.duty_id FROM         dbo.system_users 
INNER JOIN dbo.wf_task ON dbo.system_users.id = dbo.wf_task.user_id WHERE     
(dbo.wf_task.state = N'未处理') AND (dbo.wf_task.processtype = N'发起人'))union
(SELECT     dbo.wf_task.task_id,dbo.wf_task.ptask_id,dbo.wf_task.uniqueid, dbo.wf_task.taskname, dbo.wf_task.state, dbo.wf_task.processtype, 
 dbo.system_users.id, dbo.system_users.name,dbo.system_users.duty_id FROM       
  dbo.system_users INNER JOIN dbo.system_dutys ON dbo.system_users.duty_id = dbo.system_dutys.id 
INNER JOIN dbo.wf_task ON dbo.system_dutys.id = dbo.wf_task.user_id WHERE    
 (dbo.wf_task.state = N'未处理') AND (dbo.wf_task.processtype = N'按职务'))) a where a.id=@ID">
        <SelectParameters>
                <asp:Parameter DefaultValue="1" Name="ID" Type="Decimal" />
            </SelectParameters>
        </asp:SqlDataSource>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:OAonlineConnectionString %>" 
            SelectCommand="SELECT wf_wf.wf_id, wf_wf.form_id, wf_wf.wftemplate_id, wf_wf.name AS 流程, wf_wftype.wftype_name AS 分类 FROM wf_wf INNER JOIN wf_wftype ON wf_wf.wftype_id = wf_wftype.wftype_id">
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
